<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>启动页</title>
    <style>
        :root {
            --primary-color: var(--app-primary-color);
            --minor-primary-color: var(--app-minor-primary-color);
        }
        :root [theme="white"] {
            --background-color: rgb(248, 248, 248);
            --text-color2: rgba(0,0,0,.65);
        }
        :root [theme="dark"] {
            --background-color: rgb(16, 16, 20);
            --text-color2: rgba(255,255,255,.65);
        }
    </style>
    <style>
        html,body {
            height: 100%;
        }

        body {
            margin: 0;
            overflow: hidden;
            -webkit-user-select: none;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        #hero {
            flex: 1;
            box-sizing: border-box;
            padding: 32px;
            text-align: center;
            background-color: var(--background-color);
            border-radius: 20px;
        }

        .tagline {
            font-size: 36px;
            line-height: 1.25;
            font-weight: bold;
            letter-spacing: -1.5px;
            max-width: 400px;
            margin: 0 auto;
        }
        html:not(.dark) .accent,
        .dark .tagline {
            background: -webkit-linear-gradient(315deg, var(--primary-color) 25%, var(--minor-primary-color));
            background-clip: text;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .description {
            max-width: 400px;
            line-height: 1.5;
            color: var(--text-color2);
            transition: color .5s ease-in;
            font-size: 16px;
            margin: 24px auto 40px;
        }
        .version {
            font-size: 13px;
            color: var(--primary-color);
            transition: color .5s ease-in .5s;
        }
    </style>
</head>
<body theme="white">
<section id="hero">
    <img src="../images/logo.png" width="140" height="140" alt="Logo">
    <h1 class="tagline">
        <span class="accent">Egg-Tpl</span>
    </h1>
    <p class="description">
        A fast, desktop software development framework
    </p>
    <p class="version">
        v0.0.1 &copy;Egg-Tpl
    </p>
</section>
<script>
    const Renderer = (window.require && window.require('electron')) || window.electron || {};
    const ipc = Renderer.ipcRenderer || {};
    const doc = window.document;

    const {
        appTheme='white',
        appPrimaryColor='#63e2b7',
        appMinorPrimaryColor='#647eff'
    } = ipc.sendSync('controller/home/getAppConfig') || {};
    doc.documentElement.setAttribute(
        'style',
        `--app-primary-color:${appPrimaryColor};
            --app-minor-primary-color:${appMinorPrimaryColor};`
    );
    doc.body.setAttribute('theme', appTheme);
</script>
</body>
</html>
